Skip to content

Conversation

@mdo
Copy link
Member

@mdo mdo commented Oct 20, 2025

Unrelated:

API:

  • Updates the API to allow multiple property keys. This was necessary for the new font-sizes Sass map that sets font-size and line-height.
  • We now generate a JSON object of our utilities, making it easier to reference utilities in the docs.

Display:

  • Removed print display utilities, and all print logic in the utility API.

Flex & Grid:

  • Moved .grid-cols-* classes to the utility API.
  • Added utilities for grid-auto-flow
  • Added grid and gap docs pages for utilities

Type/Font:

  • Added .font-body utility. This joins the existing .font-monospace.
  • Dropped .display-* typography classes—their name is confusing next to display property utilities.
  • Added new .text-* utilities that set font-size and line-height in sizes xs6xl. This also updates the font-size .fs-{size} utilities.
  • Docs: Split Text page into separate pages for font-size, font-family, font-weight, and line-height

Colors:

  • .text-{color} is now .fg-{color} to match background utilities
  • New foreground color names and options
    • .text-body-emphasis, .text-body-secondary, and .text-body-tertiary are no more
    • Added .fg-1, .fg-2, and .fg-3
    • Updated theme colors also reflected in .fg-{color} options
  • .bg-{color}-subtle is now .bg-subtle-{color}
  • Added .bg-muted-{color} utilities
  • Color, background color, and border color utilities now set a CSS variable and consumes it in a declaration. This allows for easier opacity changes via color-mix(). For example:
     .bg-primary {
       --bs-bg: var(--bs-primary-500);
       background-color: var(--bs-bg);
     }

Links/Underlines
Link and underline utilities have some new names, values, and all around new utilities. Most name changes were to avoid unnecessarily tying these classes to hyperlinks alone, when underlining can also be a form of emphasis.

  • .link-opacity-{value} is now .link-{value}
    • Moved from 0, 25, 50, 75, 100 to increments of 10
  • .link-underline-opacity-{value} is now .link-underline-{value}
    • Moved from 0, 25, 50, 75, 100 to increments of 10
  • .link-offset-{value} is now .underline-offset-{value}
  • .link-underline-{color} is now .underline-{color}
  • Added .underline-thickness-{value}
  • Docs: Split Links page into a Text Decoration page for relevant utilities

Todos:

  • Double check font/type/text docs
  • Resolve the clamp() experiment to potentially replace RFS

Follow-ups:

  • Switch from an infix to a prefix for responsive and state/pseudo utilities (e.g., hover:opacity-50 and md:d-block)
  • Move from state to pseudo-classes and pseudo-elements
  • Restore print in the API maybe? But leave disabled for display
  • Split utilities to a whole new top-level nav link?

@mdo mdo added this to v6.0.0 Oct 20, 2025
@mdo mdo added the css label Oct 20, 2025
@mdo mdo requested a review from a team as a code owner October 20, 2025 02:17
@github-project-automation github-project-automation bot moved this to Inbox in v6.0.0 Oct 20, 2025
@theodorejb
Copy link

Why remove the print display utilities? It's common for business apps to have certain pages which need to support printing to PDF, and the print display utilities have been very handy to hide or display content as needed when printing.

@mdo
Copy link
Member Author

mdo commented Oct 20, 2025

Why remove the print display utilities? It's common for business apps to have certain pages which need to support printing to PDF, and the print display utilities have been very handy to hide or display content as needed when printing.

Not opposed to bringing back, but it's definitely a less common use case overall. I think at the very least we'd disable having print enabled on display utilities by default.

@theodorejb
Copy link

While less common, it has still been a useful feature to always have available. E.g. I made a library for Bootstrap projects which uses d-print-none to hide certain elements when printing, and if this class isn't always enabled then the library would have to implement it separately in order to rely on it.

@mdo
Copy link
Member Author

mdo commented Oct 20, 2025

While less common, it has still been a useful feature to always have available. E.g. I made a library for Bootstrap projects which uses d-print-none to hide certain elements when printing, and if this class isn't always enabled then the library would have to implement it separately in order to rely on it.

The utility API has always been extensible, so enabling isn't a huge issue unless you're pulling in from CSS only vs source Sass. As long as you're able to modify the map—which is documented—we could keep the ability and just disable it to start.

mdo added 13 commits October 21, 2025 14:04
- Split several utilities across smaller pages
- New underline thickness utility
- Updated text-wrap utility to use `text-wrap` property, removes white-space utils
- Adds a dozen new width utilities for now—TBD if we keep this, they're not documented yet
- Redoes the color utilities—color, background color, border color, link color—to use color-mix without attribute selectors. Faster, simpler, better support for overriding other components.
- Redesigns margin, padding, gap utils pages—shoutout Tailwind for having a better visualization here. Cribbed their approach to emphasize spacing utilities.
- Fixed up a lot of usages of color utilities, likely more to do
- Fixed up a lot of broken links, probably also more to do
@mdo mdo merged commit fdc1891 into v6-dev Nov 6, 2025
10 checks passed
@mdo mdo deleted the v6-utilities-cleanup branch November 6, 2025 23:18
mdo added a commit that referenced this pull request Nov 14, 2025
* Split font utilities, update API to do more pseudo classes, drop display type classes

* Improve display docs, remove print display utils

* Document gap and grid utils, rename a couple classes

* better url

* Fix color-mix

* Undo utilities API change for now

* fix api changes

* Bundlewatch

* Linter cleanup

* Massive utilities update

- Split several utilities across smaller pages
- New underline thickness utility
- Updated text-wrap utility to use `text-wrap` property, removes white-space utils
- Adds a dozen new width utilities for now—TBD if we keep this, they're not documented yet
- Redoes the color utilities—color, background color, border color, link color—to use color-mix without attribute selectors. Faster, simpler, better support for overriding other components.
- Redesigns margin, padding, gap utils pages—shoutout Tailwind for having a better visualization here. Cribbed their approach to emphasize spacing utilities.
- Fixed up a lot of usages of color utilities, likely more to do
- Fixed up a lot of broken links, probably also more to do

* New details component, simpler a11y color contrast warning, updated docs bottom nav, updated ref tables

* Avoid name collision, update to demo thickness hover

* Rename $new-font-sizes to $font-sizes

* Update width and height docs

* Few cleanup tweaks

* Remove unused attribute selector for borders

* Fixes

* more bundle

* fixes

* spelling

* add json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

3 participants